﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraCharts;
using DevExpress.XtraEditors;
using DevExpress.XtraSplashScreen;
using Sumen.Business.Model.Presenter.Report;
using Sumen_Stock.LookAndFeel.Sumen_System;

namespace Sumen_Stock.LookAndFeel.Report
{
    public partial class ReportInwardOutward : DevExpress.XtraEditors.XtraForm
    {
        private ReportInwardOutwardPresenter _reportInwardOutwardPresenter;

        public ReportInwardOutward()
        {
            InitializeComponent();
            _reportInwardOutwardPresenter = new ReportInwardOutwardPresenter();
            txtDate.DateTime = DateTime.Now;
        }

        public override void Refresh()
        {
            base.Refresh();
            LoadForm();
        }

        private void btnView_Click(object sender, EventArgs e)
        {
            LoadForm();
        }



        void LoadForm()
        {
            SplashScreenManager.ShowForm(typeof(WaitForm1));
            var list = _reportInwardOutwardPresenter.TotalInwardOutwardByMonthInYear(txtDate.DateTime.Year);
            chartControl1.DataSource = list;
            SplashScreenManager.CloseForm();
            //chartControl1.ExportToXlsx("e:/abc.xlsx");
        }


    }
}